class Poligon
{Punct puncte[100];
 public:
   Poligon(int n);
 bool isPoligon();
 bool isTriunghi();
 bool isPatrat();
 bool isDreptunghi();
 bool isConvex();
 bool isConcav();
 bool operator==(Poligon);
 bool operator<(Poligon);
 double Aria();
};

Poligon::Poligon(int n)
{int i;
 double x,y;
 for(i=0,i<n;i++)
   {scanf("%f",x);
    scanf("%f",y);
    puncte[i]=Punct(x,y);
   }
}

int Poligon::nrPuncte()
{Punct p=Punct(0,0);
 int i;
 for(i=1;i<100&&this->puncte[i]!=this->puncte[0]&&this->puncte[i]!=p;i++)
 return i;
}

bool Punct::operator!=(Punct p)
{return ((*this).x!=p.getx())&&((*this).y!=p.gety()));
}

bool Poligon::isPoligon()
{int k;
 k=(*this).nrPuncte();
 if((*this).puncte[0]==(*this).puncte[k-1]) return true;
 else return false;
}

Punct Poligon::generarePunctInterior()
{double xmin,xmax,ymin,ymax;
 xmin=xmax=(*this).puncte[0].getx();
 ymin=ymax=(*this).puncte[0].gety();
 for(int i=1;i<=(*this).nrPuncte();i++)
   {if((*this).puncte[i].getx()<xmin)
      xmin=(*this).puncte[i].getx();
    if((*this).puncte[i].getx()>xmax)
      xmax=(*this).puncte[i].getx();
    if((*this).puncte[i].gety()<ymin)
      ymin=(*this).puncte[i].gety();
    if((*this).puncte[i].gety()>ymax)
      ymax=(*this).puncte[i].gety();
 srand((unsigned int) time(0));
 xgenerat=random(xmin,xmax);
 ygenerat=random(ymin,ymax);
 Punct p=Punct(xgenerat,ygenerat);
 return p;
}
